from rest_framework.serializers import ModelSerializer, DateTimeField, SerializerMethodField
from .models import *


class UserSer(ModelSerializer):
    class Meta:
        model = UserModel
        exclude = ['password']


class GoodsSer(ModelSerializer):
    class Meta:
        model = GoodsModel
        fields = '__all__'


class RecordSer(ModelSerializer):
    user = UserSer()
    goods = GoodsSer()

    class Meta:
        model = RecordModel
        fields = '__all__'
